package com.woniu.scss.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "zy_product")
public class Product implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.INPUT)
    private String id;

    /**
     * 商品名称
     */
    @TableField(value = "`name`")
    private String name;

    /**
     * 单价
     */
    @TableField(value = "price")
    private BigDecimal price;

    /**
     * 商品所属类型
     */
    @TableField(value = "product_type")
    private Integer productType;

    /**
     * 商品封面
     */
    @TableField(value = "product_img")
    private String productImg;

    /**
     *商品状态1下架，2上架,  3:售罄
     */
    @TableField(value = "`status`")
    private Integer status;

    /**
     * 库存
     */
    @TableField(value = "stock")
    private Integer stock;

    /**
     * 1自己商品，0属于ecss
     */
    @TableField(value = "ecss")
    private Integer ecss;

    /**
     * 业务类型
     */
    @TableField(value = "business_id")
    private String businessId;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH-mm-ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH-mm-ss")
    private Date createTime;

    /**
     * 修改时间
     */
    @TableField(value = "update_time")
    private Date updateTime;

    /**
     * 修改人
     */
    @TableField(value = "update_by")
    private String updateBy;

    /**
     * 累计销量
     */
    @TableField(value = "cumulative_sales")
    private Integer cumulativeSales;

    private static final long serialVersionUID = 1L;
}